home *** CD-ROM | disk | FTP | other *** search
- #! /bin/sh
- # $Header: Configure,v 3.6 88/09/08 17:40:43 pb Exp $
- #
- # If these # comments don't work, trim them. Don't worry about the other
- # shell scripts, Configure will trim # comments from them for you.
- #
- # $Log: Configure,v $
- # Revision 3.6 88/09/08 17:40:43 pb
- # As installed on global
- #
- # Revision 3.6 88/09/08 17:40:43 pb
- # Distribution of VME: VME + new level for errors + speed up + misc tidies
- #
- # Revision 3.5 88/05/27 06:30:06 pb
- # Distribution of EdText: Edtext + check .cf args + triple to file num + make to temp files
- #
- # Revision 3.4 87/07/11 11:42:24 pb
- # Add quiet switch
- #
- # Revision 3.3 87/05/16 06:20:23 pb
- # Fix typo
- #
- # Revision 3.2 87/03/26 11:46:10 pb
- # Distribution of SendmailUK14Upgrade: Upgrade for .dom and .chn files
- #
- # Revision 3.1 86/12/23 13:25:15 pb
- # Distribution of VmsAppRelayFix: Omit entries for VMS if application relay + DBM+PRIME formats
- #
- # Revision 3.0 86/09/26 10:29:01 pb
- # Distribution of DERFIL2p0: Pre-release for DERFIL2
- #
-
- # Yes, you may rip this off to use in other distribution packages.
-
- # list of possible configurations
- configlist="fyork fx25hosts fmmdf ftext fsmail fvms4 fvms5 fsendmail fyork21 fdbm1 fprime fedtext fvme fpp"
-
- CONFIG=''
- c=''
- cpp=''
- eunice=''
- eunicefix=': # '
- iandd=''
- libc=''
- libexp=''
- manext=''
- mansrc=''
- mmdfboth=''
- n=''
- novfork=''
- novoid=''
- publicbin=''
- sharpbang=''
- shsharp=''
- startsh=''
- strchr=''
- datadir=''
- memset=''
- wdbm=''
- awkf=''
- dirsample=''
- vms21=''
- prime=''
- edtext=''
- smailname=''
-
- : sanity checks
- PATH='.:/bin:/usr/bin:/usr/local/bin:/usr/ucb:/usr/local:/usr/lbin:/etc'
- export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh $0; kill $$)
-
- if test ! -t 0; then
- echo "Say 'sh Configure', not 'sh <Configure'"
- exit 1
- fi
-
- tmode=''
- all=''
- quiet=''
- quick=''
- blank=' '
-
- while test $# -gt 0
- do case "$1" in
- quiet) tmode="$tmode quiet";;
- quick) tmode="$tmode quick";;
- all) tmode="$tmode all" ;;
- normal) tmode="$tmode " ;;
- *) echo unknown mode "'"$1"'"
- exit 1;;
- esac
- shift
- done
-
- allsys=""
- for prog in $configlist ; do eval $prog="" ; done
-
- : get old answers, if there is a config file out there
- if test -f config.sh; then
- echo "(Fetching default answers from your old config.sh file...)"
- . config.sh
- fi
-
- mode="${tmode-$mode}"
- case "$mode" in *quiet*) quiet=quiet;; esac
- case "$mode" in *quick*) quick=quick;; esac
- case "$mode" in *all*) all=all;; esac
-
- # If quiet, set echoq to do nothing.
- case "$quiet" in
- '') echoq=echo;;
- *) echoq=true;;
- esac
-
- : some greps do not return status, grrr.
- echo "grimblepritz" >grimble
- if grep blurfldyick grimble >/dev/null 2>&1 ; then
- contains=contains
- else
- if grep grimblepritz grimble >/dev/null 2>&1 ; then
- contains=grep
- else
- contains=contains
- fi
- fi
- rm grimble
- : the following should work in any shell
- case $contains in
- contains*)
- case "$quiet" in
- ?*) $echoq " "
- $echoq "AGH! Grep doesn't return a status. Attempting remedial action.";;
- esac
- cat >contains <<'EOSS'
- grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
- EOSS
- chmod 755 contains
- esac
-
- : first determine how to suppress newline on echo command
- $echoq "Checking echo to see how to suppress newlines..."
- (echo "hi there\c" ; echo " ") >.echotmp
- if $contains c .echotmp >/dev/null 2>&1 ; then
- $echoq "...using -n."
- n='-n'
- c=''
- else
- $echoq "...using \\\c."
- n=''
- c='\c'
- fi
- case "$quick+$quiet" in
- +)
- echo $n "Type carriage return to continue. Your cursor should be here-->$c"
- read ans;;
- ?*+*)
- $echoq $n "This should all -->$c"
- $echoq "<-- be one line"
- blank="$n $c";;
- esac
- rm .echotmp
-
- : now set up to do reads with possible shell escape
- : if this does not work on your machine, 1,$s/. myread/read ans/
- cat <<EOSC >myread
- ans='!'
- while expr "X\$ans" : "X!" >/dev/null; do
- read ans
- case "\$ans" in
- !)
- sh
- echo " "
- echo $n "Your answer: $c"
- ;;
- !*)
- set \`expr "X\$ans" : "X!\(.*\)\$"\`
- sh -c "\$*"
- echo " "
- echo $n "Your answer: $c"
- ;;
- esac
- done
- EOSC
-
- : general instructions
- case "$quick" in
- '')
- sysn=nrs
- cat <<EOH
-
- FOR A FAST CONFIGURATION, USE "Configure quick" (and/or quiet)
-
- This installation shell script will examine your system and ask you questions
- to determine how $sysn and its auxiliary files should be installed. If you
- get stuck on a question, you may use a ! shell escape to start a subshell or
- execute a command. Many of the questions will have default answers in square
- brackets--typing carriage return will give you the default.
- On some of the questions which ask for file or directory names you are
- allowed to use the ~name construct to specify the login directory belonging to
- "name", even if you don't have a shell which knows about that.
- Questions where this is allowed will be marked "(~name ok)"
- Much effort has been expended to ensure that this shell script will run on
- any Unix system. If despite that it blows up on you, your best bet is to edit
- Configure and run it again. Also let me (pb@uk.ac.cam.cl) know how I blew it.
-
- This installation script affects things by doing direct variable substitutions
- on some of the files included in this kit. You can give configure arguments:
- quick (to zip through quickly, not asking you to confirm each answer)
- quiet (to omit comments on what it is doing and confirmation of its guesses)
- all (to force it to ask you all questions)
- normal(to cancel the all the above saved options)
-
- EOH
- echo $n "[Type carriage return to continue] $c"
- . myread;;
- esac
-
- : ----------Now for the statndard Configure stuff ----------
- $echoq " "
- $echoq " ... Configuring configure to your system ..."
-
- : get list of predefined functions in a handy place
- $echoq " "
- if test -f /lib/libc.a; then
- $echoq "Your C library is in /lib/libc.a. You're normal."
- libc=/lib/libc.a
- else
- if test -f /usr/lib/libc.a; then
- $echoq "Your C library is in /usr/lib/libc.a, of all places."
- libc=/usr/lib/libc.a
- else
- if test -f "$libc"; then
- $echoq "Your C library is in $libc, like you said before."
- else
- cat <<'EOM'
-
- I can't seem to find your C library. I've looked for /lib/libc.a and
- /usr/lib/libc.a, but neither of those are there. What is the full name
- EOM
- echo $n "of your C library? $c"
- . myread
- libc="$ans"
- fi
- fi
- fi
-
- case "$all$cpp" in
- ''|all*)
- : see how we invoke the C preprocessor
- $echoq $blank
- $echoq "Checking to see how your C preprocessor is invoked..."
- cat <<'EOT' >testcpp.c
- #define ABC abc
- #define XYZ xyz
- ABC+XYZ
- EOT
- $echoq 'Maybe "cc -E" will work...'
- cc -E testcpp.c >testcpp.out 2>&1
- if $contains 'abc+xyz' testcpp.out >/dev/null 2>&1 ; then
- $echoq "Yup, it does."
- cpp='cc -E'
- else
- $echoq 'Nope...maybe "cc -P" will work...'
- cc -P testcpp.c >testcpp.out 2>&1
- if $contains 'abc+xyz' testcpp.out >/dev/null 2>&1 ; then
- $echoq "Yup, that does."
- cpp='cc -P'
- else
- $echoq 'Nixed again...maybe "/lib/cpp" will work...'
- /lib/cpp testcpp.c >testcpp.out 2>&1
- if $contains 'abc+xyz' testcpp.out >/dev/null 2>&1 ; then
- $echoq "Hooray, it works! I was beginning to wonder."
- cpp='/lib/cpp'
- else
- $echoq 'Hmm...maybe you already told me...'
- case "$cpp" in
- '') ;;
- *) $cpp testcpp.c >testcpp.out 2>&1;;
- esac
- if $contains 'abc+xyz' testcpp.out >/dev/null 2>&1 ; then
- $echoq "Hooray, you did! I was beginning to wonder."
- else
- echo "Nope. I can't find a C preprocessor. Name one: $c"
- . myread
- cpp="$ans"
- $cpp testcpp.c >testcpp.out 2>&1
- if $contains 'abc+xyz' testcpp.out >/dev/null 2>&1 ; then
- $echoq "OK, that will do."
- else
- echo "Sorry, I can't get that to work. Go find one."
- exit 1
- fi
- fi
- fi
- fi
- fi
- rm -f testcpp.c testcpp.out
- ;;
- *) $echoq "assuming C preprocessor is still $cpp";;
- esac
-
- case "$shsharp+$spitshell+$sharpbang" in
- ?*+?*+?*)
- $echoq "assuming sh still accepts $sharpbang $spitshell $shsharp";;
- *)
- : see if sh knows # comments
- $echoq $blank
- $echoq "Checking your sh to see if it knows about # comments..."
- if sh -c '#' >/dev/null 2>&1 ; then
- $echoq "Your sh handles # comments correctly."
- shsharp=true
- spitshell=cat
- $echoq $blank
- $echoq "Okay, let's see if #! works on this system..."
- echo "#!/bin/echo hi" > try
- $eunicefix try
- chmod 755 try
- try > today
- if test -s today; then
- $echoq "It does."
- sharpbang='#!'
- awkf=""
- else
- echo "#! /bin/echo hi" > try
- $eunicefix try
- chmod 755 try
- try > today
- if test -s today; then
- $echoq "It does."
- sharpbang='#! '
- awkf=""
- else
- $echoq "It doesn't."
- sharpbang=': use '
- awkf="awk -f"
- fi
- fi
- else
- $echoq "Your sh doesn't grok # comments--I will strip them later on."
- shsharp=false
- echo "exec grep -v '^#'" >spitshell
- chmod 755 spitshell
- $eunicefix spitshell
- spitshell=`pwd`/spitshell
- $echoq "I presume that if # doesn't work, #! won't work either!"
- sharpbang=': use '
- awkf="awk -f"
- fi
- ;;
- esac
- rm -rf try today
-
- : figure out how to guarantee sh startup
- $echoq $blank
- case "$quick" in
- '')
- $echoq $n "Check sh startup... $c"
- startsh=$sharpbang'/bin/sh'
- $echoq $n "does '$startsh' works... $c"
- cat >try <<EOSS
- $startsh
- set abc
- test "$?abc" != 1
- EOSS
-
- chmod 755 try
- $eunicefix try
- if try; then
- $echoq "Yup, it does."
- else
- $echoq "Nope. You may have to fix up the shell scripts to make sure sh runs them."
- fi
- rm -f try today
- ;;
- *) $echoq "assuming ${sharpbang}/bin/sh works" ;;
- esac
-
- : set up shell script to do ~ expansion
- cat >filexp <<EOSS
- $startsh
- : expand filename
- case \$1 in
- ~/*|~)
- echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
- ;;
- ~*)
- if test -f /bin/csh; then
- /bin/csh -f -c "glob \$1"
- echo ""
- else
- name=\`$expr x\$1 : '..\([^/]*\)'\`
- dir=\`$sed </etc/passwd -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}'\`
- if test ! -d "\$dir"; then
- me=\`basename \$0\`
- echo "\$me: can't locate home directory for: \$name" >&2
- exit 1
- fi
- case \$1 in
- */*)
- echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
- ;;
- *)
- echo \$dir
- ;;
- esac
- fi
- ;;
- *)
- echo \$1
- ;;
- esac
- EOSS
- chmod 755 filexp
- $eunicefix filexp
-
- cat <<EOSC >loc
- $startsh
- thing=\$1
- shift
- dflt=\$1
- shift
- for dir in \$*; do
- case "\$thing" in
- .)
- if test -d \$dir/\$thing; then
- echo \$dir
- exit 0
- fi
- ;;
- *)
- if test -f \$dir/\$thing; then
- echo \$dir/\$thing
- exit 0
- fi
- ;;
- esac
- done
- echo \$dflt
- exit 1
- EOSC
- chmod 755 loc
- $eunicefix loc
-
- : determine where manual pages go
- case "$mansrc" in
- '')
- dflt=`loc . /usr/man/man1 /usr/man/mann /usr/man/local/man1 /usr/man/u_man/man1 /usr/catman/u_man/man1 /usr/man/man1`
- ;;
- *) dflt="$mansrc"
- ;;
- esac
-
- case "$quiet+$quick+$mansrc+$dflt" in
- *+?*+?*+?*|?*+*+*+?*) mansrc=$dflt;;
- *) mansrc='blurfl/dyick';;
- esac
-
- while test ! -d "$mansrc" ; do
- case $mansrc in
- blurfl*) ;;
- *) echo "$mansrc does not appear to exist."
- echo "If you REALLY want it, type yes to the next question.";;
- esac
- echo " "
- echo $n "Where do the man1 manual pages (source) go? [$dflt] $c"
- . myread
- case "$ans" in
- yes|y) mansrc=`filexp $dflt`;
- break;;
- esac
- mansrc=`filexp "$ans"`
- case $mansrc in
- '') mansrc=$dflt ;;
- esac
- dflt=$mansrc
- done
-
- case "$mansrc" in
- *l)
- manext=l
- ;;
- *n)
- manext=n
- ;;
- *)
- manext=1
- ;;
- esac
-
- : ----------Now for more nrs specific stuff ----------
- $echoq " "
- $echoq " ... Now for nrs specific info ..."
-
- : check for pdp11
- $echoq " "
- case "$all$small_proc" in
- define) $echoq "assuming it still wants small processes";;
- undef) $echoq "assuming it still wants proper sized processes";;
- '')
- cat <<'EOT' >pdp11.c
- #ifdef pdp11
- exit 0
- #else
- exit 1
- #endif
- EOT
- $cpp pdp11.c | grep exit >pdp11
- chmod 755 pdp11
- $eunicefix pdp11
- rm pdp11.c
- if pdp11; then
- $echoq "This looks like a pdp11 to me."
- if $contains '\-i' $mansrc/cc.1* $mansrc/ld.1* >/dev/null 2>&1 ; then
- echo $n "Your system appears to have separate I and D space. Is this true? [y] $c"
- . myread
- case "$ans" in
- n*|f*) iandd=' ' ;;
- *) iandd='-i' ;;
- esac
- else
- echo "Your system appears to NOT have separate I and D space."
- echo $n "Is this correct? [y] $c"
- . myread
- case "$ans" in
- n*|f*) iandd='-i' ;;
- *) iandd=' ' ;;
- esac
- fi
- else
- $echoq "assuming -i not needed as this doesn't look like a pdp11 to me"
- fi
- rm -f pdp11
- ;;
- esac
-
- : index or strcpy
- $echoq $blank
- case "$all$strchr" in
- define) $echoq "assuming your system still uses strchr() and strrchr()";;
- undef) $echoq "assuming your system still uses index() and rindex()";;
- *) if ar t $libc | $contains index.o >/dev/null 2>&1 ; then
- $echoq "Your system appears to use index() and rindex() rather than strchr()"
- $echoq $n "and strrchr(). Is this correct? [y] $c"
- case "$quiet" in
- quiet) ans=$dflt;;
- *) . myread;;
- esac
- case "$ans" in
- n*|f*) strchr='define' ;;
- *) strchr='undef' ;;
- esac
- else
- $echoq "Your system appears to use strchr() and strrchr() rather than index()"
- $echoq $n "and rindex(). Is this correct? [y] $c"
- case "$quiet" in
- quiet) ans=$dflt;;
- *) . myread;;
- esac
- case "$ans" in
- n*|f*) strchr=undef ;;
- *) strchr=define ;;
- esac
- fi
- ;;
- esac
-
- : bzero or memset
- $echoq $blank
- case "$all$memset" in
- define) $echoq "assuming your system still uses memset()";;
- undef) $echoq "assuming your system still uses bzero()";;
- *) if ar t $libc | $contains bzero.o >/dev/null 2>&1 ; then
- $echoq "Your system appears to use bzero() rather than memset()"
- $echoq $n "Is this correct? [y] $c"
- case "$quiet" in
- quiet) ans=$dflt;;
- *) . myread;;
- esac
- case "$ans" in
- n*|f*) memset='define' ;;
- *) memset='undef' ;;
- esac
- else
- $echoq "Your system appears to use memset() rather than bzero()"
- $echoq $n "Is this correct? [y] $c"
- case "$quiet" in
- quiet) ans=$dflt;;
- *) . myread;;
- esac
- case "$ans" in
- n*|f*) memset=undef ;;
- *) memset=define ;;
- esac
- fi
- ;;
- esac
-
-
- : hostname ?
- $echoq $blank
- case "$all$gethostname" in
- define) $echoq "assuming your system still uses gethostname()";;
- undef) ;;
- *) if ar t $libc | $contains gethostname.o >/dev/null 2>&1 ; then
- $echoq "Your system appears to use gethostname()"
- gethostname='define'
- uname='undef'
- else
- gethostname='undef'
- fi
- ;;
- esac
-
- : uname ?
- $echoq $blank
- case "$all$uname" in
- define) $echoq "assuming your system still uses uname()";;
- undef) ;;
- *) if ar t $libc | $contains uname.o >/dev/null 2>&1 ; then
- $echoq "Your system appears to use uname()"
- uname='define'
- gethostname='undef'
- else
- uname='undef'
- fi
- ;;
- esac
-
- : check for void type
- $echoq $blank
- case "$all$novoid" in
- define) $echoq "assuming int should still be used in place of void" ;;
- undef) $echoq "assuming cc still understands void" ;;
- *)
- $echoq "Checking to see if your C compiler groks the void type..."
- cat >try.c <<'EOCP'
- void main();
- EOCP
- if cc -c try.c >/dev/null 2>&1 ; then
- novoid='undef'
- $echoq "Yup, it does."
- else
- novoid='define'
- $echoq "Nope, it doesn't (boo hiss). I will substitute int."
- fi
- rm try.*
- ;;
- esac
-
- : determine where public executables go
- case "$publicbin" in
- '')
- dflt=`loc . /bin /usr/local/bin /usr/lbin /usr/local /usr/bin`
- ;;
- *) dflt="$publicbin"
- ;;
- esac
-
- case "$quick+$publicbin+$dflt" in
- ?*+?*+?*) publicbin=$dflt $echoq "assuming public binaries still go in $publicbin";;
- *) publicbin='blurfl/dyick';;
- esac
-
- while test ! -d "$publicbin" ; do
- case $publicbin in
- blurfl*) ;;
- *) echo "$publicbin does not appear to exist."
- echo "If you REALLY want it, type yes to the next question.";;
- esac
- echo " "
- echo $n "Where do you want to put the public executables? [$dflt] $c"
- . myread
- case "$ans" in
- yes|y) publicbin=`filexp $dflt`;
- break;;
- esac
- publicbin=`filexp $ans`
- case $publicbin in
- '') publicbin=$dflt ;;
- esac
- dflt=$publicbin
- done
-
- : determine where the DERFIL file goes
- case "$datadir" in
- '')
- dflt=`loc . /info/nets/nrs`
- ;;
- *) dflt="$datadir"
- ;;
- esac
- case "$quick+$datadir+$dflt" in
- ?*+?*+?*) datadir=$dflt $echoq "assuming DERFIL still goes in $datadir";;
- *) datadir='blurfl/dyick';;
- esac
- while test ! -d "$datadir" ; do
- case $datadir in
- blurfl*) ;;
- *) echo "$datadir does not appear to exist."
- echo "If you REALLY want it, type yes to the next question.";;
- esac
- echo " "
- echo $n "In which directory do you want to put the DERFIL ? [$dflt] $c"
- . myread
- case "$ans" in
- yes|y) datadir=`filexp $dflt`;
- break;;
- esac
- datadir=`filexp $ans`
- case $datadir in
- '') datadir=$dflt ;;
- esac
- dflt=$datadir
- done
-
- for f in $configlist
- do
- val=`eval echo \\$$f`
- nam=`expr $f : 'f\(.*\)'`
- case "$all$val" in
- define) $echoq "assuming $nam format is still wanted" ;;
- undef) $echoq "assuming $nam format is still not wanted" ;;
- *) dflt=yes
- echo $n "is the format $nam wanted [$dflt] $c"
- . myread
- case $ans in
- ''|y*) eval $f=define ;;
- *) eval $f=undef ;;
- esac ;;
- esac
- done
-
- case "$fsmail+$all+$smailname" in
- define+?*+*|define++)
- cat <<!
- smail generates an alias file by stripping off components common to your site
- !
- dflt="$smailname"
- echo $n "NRS name. What is the your site NRS name [$dflt] $c"
- . myread
- case "$ans" in
- '') ans="$dflt";;
- esac
- smailname=`echo "$ans" | tr a-z A-Z`
- ;;
- define*) $echoq "assuming NRS name for sendmail is still '$smailname'";;
- esac
-
- case "$all+$fmmdf+$mmdfboth" in
- ?*+define*|+define+)
- cat <<!
- The mmdf channel tables need only have one format (short or long) of names
- as the domain tables should only generate one format.
- However it is possible to generate both formats and get a bigger file.
- !
- dflt=no
- echo $n "are both formats wanted [$dflt] $c"
- . myread
- case $ans in
- y*) mmdfboth=define ;;
- *) mmdfboth=undef ;;
- esac ;;
- +define+define) $echoq "assuming mmdf channel tables still have long AND short formats" ;;
- +define+undef) $echoq "assuming mmdf channel tables still have only one format" ;;
- *+undef+) mmdfboth=undef ;;
- esac
-
- : Now ask where wdbm is
- $echoq $blank
- case "$fyork+$all$wdbm" in
- undef+)
- $echoq assuming wdbm not used if york format not wanted.
- ;;
- *+|*+all*)
- cat <<!
- Wdbm is the programme which writes dbm copies of the directory.
- (- means that there is none)
- !
- dflt="$wdbm"
- case "$dflt" in
- '') if [ -f /usr/lib/x25/wdbm ]
- then dflt=/usr/lib/x25/wdbm
- fi;;
- esac
- echo $n "What is the pathname for wdbm [$dflt] $c"
- . myread
- case "$ans" in
- '') ans="$dflt";;
- esac
- case "$ans" in
- '-'|'') wdbm=" " ;;
- *) wdbm="$ans" ;;
- esac
- ;;
- '*+ ') $echoq "assuming wdbm is still not available";;
- *) $echoq "assuming wdbm is still '$wdbm'";;
- esac
-
- : Check for tailor file if none
- $echoq $blank
- case "$fmmdf+$sendmail" in
- *define*)
- dflt="ed tailor"
- while test ! -r tailor ; do
- cat <<'EOM'
- mmdf.cf and sendmail.cf send their output to a number of different files.
- The standard ones (uk.ac, uk.co, etc) are in the main .cf files, but most
- sites want to add their own.
- To do this create a file called tailor in the current directory with lines of
- the form:
- filedmn cl.dom uk.ac.cam.cl. uk.ac.cambridge.computer-lab.
- filedmn cam.dom uk.ac.cam. uk.ac.cambridge.
-
- If you do not need any tailoring, create a null file.
-
- Unless your answer is the word 'none' I shall run your answer
- and then check that tailor exists.
- [ you can use the escape mechanism if you want ]
- EOM
- echo $n "What command (or 'none') do you want to run ? [$dflt] ? $c"
- . myread
- case "$ans" in
- '') ans="$dflt" ;;
- esac
- case "$ans" in
- none) ;;
- *) sh -c "$ans" ;;
- esac
- done
- esac
-
- : Now ask what to sample in DATADIR
- $echoq $blank
- case "$all$dirsample" in
- '')
- cat <<!
- The makefile knows when to remake the various output formats by comparing
- their date with that of the DERFIL from Salford.
- This should be DERFIL2 but may still be DERFIL1.
- (If you INSIST on using filettes, you can use MODULE2)
- !
- if test -r $datadir/DERFIL2
- then dflt=DERFIL2
- elif test -r $datadir/DERFIL1
- then dflt=DERFIL1
- elif test -r $datadir/MODULE2
- then dflt=MODULE2
- else dflt=DERFIL2
- fi
- echo $n "What is the name of the (sample) derived file [$dflt] $c"
- . myread
- case "$ans" in
- '') dirsample=$dflt ;;
- *) dirsample=$ans ;;
- esac
- ;;
- *) $echoq "assuming sample is still $dirsample";;
- esac
-
- : preserve RCS keywords in files with variable substitution, grrr
- Log='$Log'
- Header='$Header'
- State='$State'
-
- : Warnings
- case "$v7" in
- define)
- cat <<'EOM'
-
- NOTE: the V7 compiler may ignore some #undefs.
- Some V7 compilers also have difficulties with #defines near buffer
- boundaries, so beware. You may have to play with the .h spacings.
- EOM
- ;;
- esac
-
- $echoq " "
- $echoq "End of configuration questions."
- $echoq " "
-
- : now for derived info ......
- case "$prime" in
- define) ;;
- *) prime=undef;;
- esac
- case "$vms21" in
- define) ;;
- *) vms21=undef;;
- esac
-
- : create config.sh file
- $echoq $blank
- outputfile=config.sh
- outputfile2=config.sh.$$
- rm -f $outputfile.$$
- $echoq "Creating $outputfile (with variable substitutions)"
- $spitshell <<EOT >$outputfile2
- $startsh
- # $outputfile
- # This file was produced by running the Configure script.
- #
- # First the items in lists ...
- EOT
- for x in $systems $configlist ; do echo "$x='`eval echo \\$$x`'" >> $outputfile2; done
- $spitshell <<EOT >>$outputfile2
- #
- # now the rest
- #
-
- Header='$Header'
- Log='$Log'
- State='$State'
- oldc='$c'
- cpp='$cpp'
- eunice='$eunice'
- eunicefix='$eunicefix'
- iandd='$iandd'
- libc='$libc'
- libexp='$libexp'
- manext='$manext'
- mansrc='$mansrc'
- mmdfboth='$mmdfboth'
- mode='$mode'
- echoq='$echoq'
- oldn='$n'
- novoid='$novoid'
- publicbin='$publicbin'
- shsharp='$shsharp'
- spitshell='$spitshell'
- sharpbang='$sharpbang'
- startsh='$startsh'
- strchr='$strchr'
- datadir='$datadir'
- memset='$memset'
- wdbm='$wdbm'
- awkf='$awkf'
- dirsample='$dirsample'
- gethostname='$gethostname'
- uname='$uname'
- vms21='$vms21'
- prime='$prime'
- smailname='$smailname'
-
- #
- # derived by Config
- #
- CONFIG=true
- EOT
-
- if cmp $outputfile $outputfile2 > /dev/null 2>& 1
- then
- rm -f $outputfile2
- $echoq " " $outputfile not affected
- elif mv $outputfile2 $outputfile
- then
- echo " " $outputfile updated
- else
- echo "+++ " $outputfile left in $outputfile2
- fi
-
- CONFIG=true
-
- rm -f .distlist kit*isdone loc filexp myread
-
- $echoq " "
- $echoq "Doing variable substitutions on various files..."
- $echoq " "
- if [ ! -r UNIX.LST -a ! -r /tmp/UNIX.LST ]; then ls *.SH > /tmp/UNIX.LST; fi
- set `cat UNIX.LST /tmp/UNIX.LST 2>/dev/null | grep '\.SH' | awk '{print $1}'`
- for file in $*; do
- if test -r ${file}.local ; then
- . ${file}.local
- else
- . $file
- fi
- done
- rm -f /tmp/UNIX.LST
-